/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package com.wise.common.device.type.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author gaocm
* @date 2020-10-30
**/
@Entity
@Data
@Table(name="gf_device_type")
public class GfDeviceType implements Serializable {

    @Column(name = "DEVICE_UNIT")
    @ApiModelProperty(value = "设备型号")
    private String deviceUnit;

    @Column(name = "DEVICE_NAME")
    @ApiModelProperty(value = "设备名称")
    private String deviceName;

    @Column(name = "DEVICE_ARC")
    @ApiModelProperty(value = "主轴数量")
    private BigDecimal deviceArc;

    @Column(name = "DEVICE_TYPE_CODE")
    @ApiModelProperty(value = "设备类型编号")
    private String deviceTypeCode;

    @Column(name = "SYSTEM_TYPE")
    @ApiModelProperty(value = "数控系统类型")
    private String systemType;

    @Column(name = "DEVICE_KIND")
    @ApiModelProperty(value = "设备种类")
    private String deviceKind;

    @Column(name = "PARENT_ID")
    @ApiModelProperty(value = "父id")
    private String parentId;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    @ApiModelProperty(value = "主键")
    private Long id;

    public void copy(GfDeviceType source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}